package com.onec.service.netty.handler;


import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * 1, 测试编码
 */
public class StringProcessHandler extends ChannelInboundHandlerAdapter {


  private AtomicInteger atomicInteger = new AtomicInteger(1);

  @Override
  public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {

    atomicInteger.addAndGet(1);
    String message = (String) msg;
    System.out.println("当前数字" + atomicInteger.get() + "-----" + message);
  }
}
